﻿

Partial Public Class BuchungDetailForm

#Region "IFormOptions Implementation"

    Public Sub Delete() Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.Delete
        Select Case TabControl1.SelectedIndex
            Case 0

            Case 1

            Case 2

        End Select
    End Sub

    Public Sub [New]() Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.New
        Select Case TabControl1.SelectedIndex
            Case 0
                ' nichts
            Case 1
                If Not _buchungNew Then _
                    Call NewPosition()
            Case 2
                If Not _buchungNew Then _
                    Call NewFileAttachment()
        End Select
    End Sub

    Public Sub Open() Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.Open
        Select Case TabControl1.SelectedIndex
            Case 0
                ' nichts 
            Case 1
                ' nichts
            Case 2
                Call OpenCurrentAttachment()
        End Select
    End Sub

    Public Event OptionsChanged(ByVal sender As Object, ByVal e As System.EventArgs) Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.OptionsChanged

    Public Sub PagePreview() Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.PagePreview
        Select Case TabControl1.SelectedIndex
            Case 0
                ' nichts 
            Case 1
                ' nichts
            Case 2
                Call OpenCurrentAttachment()
        End Select
    End Sub

    Public Sub Print() Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.Print
    End Sub

    Public Overrides Sub Refresh() Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.Refresh

        MyBase.Refresh()

        Select Case TabControl1.SelectedIndex
            Case 0
                BindContents()
            Case 1
                InitializePositionen()
            Case 2
                InitializeFiles()
        End Select

    End Sub

    Public Sub Save() Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.Save
        Call InternalSave()
    End Sub

    Public Sub SaveAs() Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SaveAs

    End Sub

    Public ReadOnly Property SetCoopDesign As Boolean Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SetCoopDesign
        Get
            Return False
        End Get
    End Property

    Public ReadOnly Property SetDelete As Boolean Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SetDelete
        Get
            Select Case TabControl1.SelectedIndex
                Case 0
                    Return False
                Case 1
                    Return False
                Case 2
                    Return (lvAttachments.SelectedIndices.Count > 0)
                Case Else
                    Return False
            End Select
        End Get
    End Property

    Public ReadOnly Property SetNew As Boolean Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SetNew
        Get
            Select Case TabControl1.SelectedIndex
                Case 0
                    Return False
                Case 1
                    Return (Not _buchungNew)
                Case 2
                    Return (Not _buchungNew)
                Case Else
                    Return False
            End Select
        End Get
    End Property

    Public ReadOnly Property SetOpen As Boolean Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SetOpen
        Get
            Select Case TabControl1.SelectedIndex
                Case 0
                    Return False
                Case 1
                    Return False
                Case 2
                    Return (lvAttachments.SelectedIndices.Count > 0)
                Case Else
                    Return False
            End Select
        End Get
    End Property

    Public ReadOnly Property SetPagePreview As Boolean Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SetPagePreview
        Get
            Select Case TabControl1.SelectedIndex
                Case 0
                    Return False
                Case 1
                    Return False
                Case 2
                    Return (lvAttachments.SelectedIndices.Count > 0)
                Case Else
                    Return False
            End Select
        End Get
    End Property

    Public ReadOnly Property SetPrint As Boolean Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SetPrint
        Get
            Select Case TabControl1.SelectedIndex
                Case 0
                    Return False
                Case 1
                    Return False
                Case 2
                    Return False
                Case Else
                    Return False
            End Select
        End Get
    End Property

    Public ReadOnly Property SetRefresh As Boolean Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SetRefresh
        Get
            Select Case TabControl1.SelectedIndex
                Case 0
                    Return True
                Case 1
                    Return True
                Case 2
                    Return True
                Case Else
                    Return False
            End Select
        End Get
    End Property

    Public ReadOnly Property SetSave As Boolean Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SetSave
        Get
            Return True
        End Get
    End Property

    Public ReadOnly Property SetSaveAs As Boolean Implements LibMultiPlug.Core.Plugins.Interfaces.IFormOptions.SetSaveAs
        Get
            Return False
        End Get
    End Property

#End Region

End Class

